package com.example.polarity;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

public class PlayGuiView extends View 
{
	 
	public Bitmap container;
    public Bitmap leftArrow;
	public Bitmap RightArrow;
	
	public MagnetGUI negMagnet;
	public MagnetGUI posMagnet;
	
	public PlayGuiView parentView;
	public Bitmap negativeMagnet;
	public Bitmap positiveMagent;
	
	public  PlayGuiView(Context context)
	{
		super(context);
		
		// make the GamePanel focusable so it can handle events
		setFocusable(true);
	}
	
	public PlayGuiView(Context context, AttributeSet attrs) 
	{
		super(context, attrs);
		this.setWillNotDraw(false);
		
		this.container = BitmapFactory.decodeResource(this.getResources(), R.drawable.play_screen_container);
		this.leftArrow = BitmapFactory.decodeResource(this.getResources(), R.drawable.arrow_left);
		this.RightArrow = BitmapFactory.decodeResource(this.getResources(), R.drawable.arrow_right);
		
		negativeMagnet = BitmapFactory.decodeResource(this.getResources(), R.drawable.neg_magnet);//new Magnet(parentView, 1);
		positiveMagent = BitmapFactory.decodeResource(this.getResources(), R.drawable.pos_magnet); //new Magnet(parentView, 2);
	}
	
	public PlayGuiView(Context context, AttributeSet attrs, int defStyle) 
	{
		super(context, attrs,  defStyle);
	}
	
	 @Override
	 protected void onDraw(Canvas canvas) 
	 {
		 
			//set the transparency of the bottom GUI container
			Paint paint = new Paint();
			paint.setAlpha(100);
			
			//Draw the main bottom GUI container
			//canvas.drawBitmap(this.container, 0, canvas.getHeight() - 50 , paint);
			
			//draw shield bar
			Paint paintShieldBar = new Paint();
			paintShieldBar.setColor(Color.GREEN);
			paintShieldBar.setStrokeWidth(10);
			
			//left, top , right , bottom
			//canvas.drawRect(this.getLeft() + 100, this.getTop() + 5, 200, 25, paintShieldBar);
			
			//canvas.drawRect(75, 432, 275, 462, paintShieldBar);
			//canvas.drawBitmap(this.leftArrow, (canvas.getWidth() / 2) - 150, this.getBottom() - 45, null);
			
			//canvas.drawBitmap(this.negativeMagnet, 400, 200 , null);	
			//canvas.drawBitmap(this.positiveMagent, 440, 200 , null);	
			//this.posMagnet.DrawGuiMagnet(parentView, canvas);
			//this.negMagnet.DrawGuiMagnet(parentView, canvas);
			
			
			//canvas.drawBitmap(this.RightArrow, (canvas.getWidth() / 2) + 150, this.getBottom() - 45, null);
			//canvas.drawRect(775, this.getBottom() - 90, 975, this.getBottom() - 45, paintShieldBar);
			
		 invalidate();
	 }

   
}
